#ifndef TYPES_H
#define TYPES_H

#define CHECK_TYPE_SIZE(type, size) typedef int sizeof__ ## type ## \
      __isnt_ ## size[sizeof(type) == size ? 1 : -1]
#define CHECK_STRUCT_SIZE(type, size) typedef int sizeof__ ## type ## \
      __isnt__ ## size[sizeof(struct type) == size ? 1 : -1]

#ifndef __KERNEL__

#include <stdint.h>

typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;

#else

#include <asm-generic/int-ll64.h>

#endif /* not __KERNEL__ */

CHECK_TYPE_SIZE(u8, 1);
CHECK_TYPE_SIZE(u16, 2);
CHECK_TYPE_SIZE(u32, 4);
CHECK_TYPE_SIZE(u64, 8);

// ONLY64
typedef u64 vaddr_t;


#endif /* TYPES_H */

